<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div class="box" id="abc" data-age="18" data-height="1.88">我是box</div>
  <script>
    var boxEl = document.querySelector(".box")
    console.log(boxEl.dataset) //DOMStringMap {age: '18', height: '1.88'}
    console.log(boxEl.dataset.age) //18
    console.log(boxEl.dataset.height) //1.88
  </script>
</body>

</html>